import sys, os

trunkdir = os.curdir + os.sep + os.pardir + os.sep + 'source'
sys.path += [trunkdir]

from combinatorics import *

def getvalue(l):
	return reduce(lambda x,y:10*x+y, l, 0)

lo, hi = 1, 7
numbers = range(lo, hi)
s = set()
for i in permutations(numbers): s.add(getvalue(i))
if len(s) == 720: print "permutation test: passed"
else: print "permutation test: failed"
